-
Notifications
You must be signed in to change notification settings - Fork 184
chore: Add dnd drag buttons to list #3652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d496347
to
f73fd82
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3652 +/- ##
=======================================
Coverage 97.01% 97.02%
=======================================
Files 835 835
Lines 24142 24168 +26
Branches 8414 8500 +86
=======================================
+ Hits 23422 23449 +27
+ Misses 671 670 -1
Partials 49 49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f73fd82
to
4d6bf1e
Compare
4d6bf1e
to
7c5814b
Compare
7c5814b
to
884debb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code style related comments, but overall looks good
await page.expectAnnouncement('Moving item to position 2 of 6'); | ||
|
||
await page.click(page.wrapper.findModal().findContentDisplayPreference().findTitle().toSelector()); | ||
await expect(await page.containsOptionsInOrder(['Item 2', 'Item 1'])).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could avoid an extra await
await expect(await page.containsOptionsInOrder(['Item 2', 'Item 1'])).toBe(true); | |
await expect(page.containsOptionsInOrder(['Item 2', 'Item 1'])).resolves.toBe(true); |
describe('internal icon props', () => { | ||
test('should prevent pointer events', () => { | ||
const { container } = render(<InternalIcon name="add-plus" __preventPointerEvents={true} />); | ||
expect(container.querySelector('span')).toHaveClass(styles['prevent-pointer-events']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use styles.icon
selector instead of any span
?
src/icon/internal.tsx
Outdated
@@ -16,6 +16,7 @@ import styles from './styles.css.js'; | |||
type InternalIconProps = IconProps & | |||
InternalBaseComponentProps & { | |||
badge?: boolean; | |||
__preventPointerEvents?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to avoid modifying the icon for this case?
Can pointer-events
be applied somewhere on a parent DOM node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, updated
@@ -18,23 +18,35 @@ import { EventName } from './utilities/events'; | |||
import { Listeners } from './utilities/listeners'; | |||
import { applyScroll } from './utilities/scroll'; | |||
|
|||
// Slightly modified version of @dnd-kit's KeyboardSensor: | |||
// Modified version of @dnd-kit's KeyboardSensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think if at this point we should abandon idea of ever switching back to upstream and maintain this code as fully our own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I was basically seeing it as that, I'll update the comment to make that a bit clearer
884debb
to
bf73e54
Compare
Description
Add pointer-only/"UAP" buttons to sortable list
Related links, issue #, if available: AWSUI-61051
How has this been tested?
New unit and integ tests
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.